import store from "../../store/index.js";
import { addNum } from "../../store/action.js";

export default function List() {

    let dataList = [
        {name: '测试数据1', value: '1'},
        {name: '测试数据2', value: '2'},
        {name: '测试数据3', value: '3'},
        {name: '测试数据4', value: '4'},
        {name: '测试数据5', value: '5'},
        {name: '测试数据6', value: '6'},
        {name: '测试数据7', value: '7'},
    ]


    function setCount(){
        store.dispatch(addNum(10))
    }
    return (<div>

        <div onClick={setCount}>
            修改store的数据
        </div>
        {
            dataList.map((item) => {
                return (<p key={item.value}>
                    {item.name}
                </p>)
            })
        }
    </div>)
}